import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: GodK
 * Date: 2024-06-01
 * Time: 12:36
 */
public class Main {
    public static void menu(){
        System.out.println("****************************");
        System.out.println("***1.add*********2.delete***");
        System.out.println("***3.check*******4.change***");
        System.out.println("****************************");
        System.out.print("请选择要进行的操作:");
    }
    public static void main(String[] args) throws SQLException {
        Scanner scanner = new Scanner(System.in);
        menu();
        int index = scanner.nextInt();
        switch (index){
            case 1 :
                Mysqladd mysqladd = new Mysqladd();
                int i = scanner.nextInt();
                scanner.nextLine();
                String str1 = scanner.nextLine();
                mysqladd.add(i,str1);
                break;
            case 2 :
                Mysqldelete mysqldelete = new Mysqldelete();
                scanner.nextLine();
                String str2 = scanner.nextLine();
                mysqldelete.detele(str2);
                break;
            case 3 :
                Mysqlcheck mysqlcheck = new Mysqlcheck();
                scanner.nextLine();
                Mysqlcheck.check(scanner.nextLine(),scanner.nextLine());
                break;
            case 4 :
                Mysqlchange mysqlchange = new Mysqlchange();
                int i1 = scanner.nextInt();
                scanner.nextLine();
                String str3 = scanner.nextLine();
                mysqlchange.change(i1,str3);
                break;
            default:
                System.out.println("输入错误");
                break;
        }
    }
}
